<?php

namespace App\Extensions\Renderable;

use App\PatentApply;
use Illuminate\Contracts\Support\Renderable;

class PatentExpertsDetailRenderAble implements Renderable
{
    public function render($key = '')
    {
        $model = PatentApply::query()->find($key);
        $table =  new \Encore\Admin\Widgets\Table(['姓名', '联系电话', '职称', '专业领域', '单位'], $model->experts->map(function ($item) {
            return $item->only(['name', 'mobile', 'academic_title', 'major', 'company']);
        })->toArray());
        return $table->render();
    }

}
